
#ifndef __MATRIX_OP
#define __MATRIX_OP

#define ADD_VECTORS 1
#define SUBTRACT_VECTORS -1
#define IS_POSITIVE(X) ((X) > 0.00000001)
#define ABS(X)  ( ((X) > 0 ) ? (X) : (0 - (X)) )

#ifndef elem
	#define elem double
	#define elem_scan_format "%lf"
#endif

typedef struct _Vector{
	elem* data;
	int size;
}Vector;


int max_element(const elem* vector, const int vector_size);
Vector* allocate_Vector(int n);
void free_vector(Vector* vector);
elem scalar_mlpl(Vector* v1,Vector* v2);
void diagonal_matrix_vector_mlpl(Vector* diag,Vector* x,Vector* result);
void add_vectors(Vector* a, Vector* b, Vector* result, int op);
elem vector_norm(Vector* vector);
void normalize_vector(Vector* vector);
void scalar_vector_mlpl(elem scalar, Vector* x, Vector* result);
void vector_copy(Vector* dstVector, Vector* srcVector);
elem matrix_norm1_by_rows(elem* matrix, int size);
elem matrix_norm1_by_columns(elem* matrix, int size);
void matrix_vector_mlpl(const elem* matrix, const Vector* vector, Vector* result);

/* #define ElementsArrSize 100 */
/* typedef elem ElementsArr[ElementsArrSize]; */
/* ElementsArr get_elements(Vector* v, int index); */

#endif

